// const Mock = require('mockjs')
// const data = Mock.mock({
//   'items|30': [{
//     id: '@id',
//     // 'genderStatus|1': ['published', 'draft', 'deleted'],
//     resourceName: '@cname', // 生成用户名 ， 都是中国人的名字
//     resourceUrl: '',
//     'httpMethod|1': ['get', 'post'],
//     resourceDesc: ''
//   }]
// })

module.exports = [
  {
    url: '/app/getAppServiceList',
    type: 'get',
    response: (config) => {
      return {
        code: '00000',
        data: [
          {
            id: 1,
            parentId: '0',
            code: '1',
            name: '应用1',
            level: 1,
            children: [
              {
                parentId: '1',
                code: '12',
                name: '服务1',
                level: 2,
                children: [
                  {
                    parentId: '12',
                    code: '121',
                    name: '类1',
                    level: 3
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  },
  {
    url: '/resource/getApiByAppServicePage',
    type: 'get',
    response: (config) => {
      return {
        code: '00000',
        data: {
          pageNo: 1,
          pageSize: 10,
          totalRows: 2,
          rows: [
            {
              resourceId: 1,
              resourceName: '接口1',
              resourceUrl: '/jiekou/app1',
              httpMethod: 'get',
              resourceDesc: '描述111',
              appName: '应用1',
              serviceName: '服务1',
              requiredLogin: true,
              requiredPermission: false,
              modularName: '模块名1'
            },
            {
              resourceId: 2,
              resourceName: '接口2',
              resourceUrl: '/jiekou/app2',
              httpMethod: 'post',
              resourceDesc: '描述2222',
              appName: '应用2',
              serviceName: '服务2',
              requiredLogin: false,
              requiredPermission: true,
              modularName: '模块名2'
            }
          ]
        }
      }
    }
  },
  {
    url: '/allocate/setApiAccess',
    type: 'post',
    response: (config) => {
      return {
        code: '00000',
        data: null,
        success: true,
        message: '成功'
      }
    }
  }
]
